from transformers import pipeline
from langchain_community.llms import HuggingFacePipeline
# pipe = pipeline("text-classification",device="cuda:0",model="distilbert/distilbert-base-uncased-finetuned-sst-2-english")
hf = HuggingFacePipeline.from_model_id(
    model_id="google/gemma-7b",
    task="text-generation",
    pipeline_kwargs={"max_new_tokens": 500},
)

# print(pipe("This restaurant is awesome"))
# print(pipe("我不喜欢你"))
# for i in range(5):
    # print(pipe.predict("This restaurant is awesome"))
# hf = HuggingFacePipeline(pipeline=pipe)
hf.invoke("This restaurant is awesome")




